package org.hertsig.magiccardmarket;

import org.apache.http.client.methods.HttpGet;
import org.hertsig.magiccardmarket.MagicCardMarketApi.Actor;
import org.hertsig.magiccardmarket.MagicCardMarketApi.Status;
import org.hertsig.magiccardmarket.entities.Orders;
import org.hertsig.magiccardmarket.entities.Orders.Order;

public class OrderApi extends ApiBase {
	public OrderApi(MagicCardMarketApi api) {
		super(api);
	}
	
	/**
	 * @param actor from {@link Actor}
	 * @param state one (!) from {@link Status}, cannot be OR'ed together to get more than one at a time, even though the values make it seem this should be possible
	 */
	public PartialContentIterable<Order> getOrders(int actor, int state) {
		return new PartialContentIterable<Order>(Orders.class, (start) -> api.execute(new HttpGet(api.orders(actor, state, start))));
	}
}
